<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>视频流显示</title>
    <style>
  /* Reset basic styles */
  * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: linear-gradient(45deg, #2a2a72, #009ffd);
      color: #fff;
      line-height: 1.6;
    }

    header {
      text-align: center;
      padding: 30px;
      background: rgba(0, 0, 0, 0.6);
      border-bottom: 2px solid #fff;
    }

    header h1 {
      font-size: 2.5rem;
      margin-bottom: 15px;
      text-transform: uppercase;
      letter-spacing: 2px;
    }

    header a {
      color: #fff;
      text-decoration: none;
      font-size: 1rem;
      margin: 0 20px;
      padding: 10px 15px;
      border-radius: 30px;
      background-color: #009ffd;
      transition: background-color 0.3s ease, transform 0.3s ease;
    }

    header a:hover {
      background-color: #00b8d8;
      transform: scale(1.1);
    }

    .container {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 20px;
      padding: 40px;
    }

    .section {
      background-color: rgba(0, 0, 0, 0.5);
      border-radius: 10px;
      padding: 20px;
      text-align: center;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .section:hover {
      transform: translateY(-10px);
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    }

    .section h2 {
      font-size: 1.3rem;
      margin-bottom: 10px;
      color: #fff;
      letter-spacing: 1px;
    }

    .value {
      font-size: 2.2rem;
      font-weight: bold;
      color: #00d4ff;
    }

    .value.normal {
      color: #00ff00;
    }

    .value.alert {
      color: #ff5c5c;
    }

    footer {
      background-color: #000;
      color: #fff;
      text-align: center;
      padding: 15px;
      position: fixed;
      bottom: 0;
      width: 100%;
    }

/* 主体内容样式 */
main {
  padding: 40px 10%;
}

.video-container {
  text-align: center;
  margin: 40px 0;
  background-color: rgba(0, 0, 0, 0.7); /* 半透明背景 */
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.video-container h2 {
  font-size: 28px;
  color: #00bcd4;
  margin-bottom: 20px;
}

/* 视频流展示 */
.video-stream {
  width: 100%;
  max-width: 800px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.error-message {
  color: #f44336;
  font-size: 18px;
  margin-top: 20px;
  display: none; /* 默认不显示 */
}

/* 在视频加载失败时显示错误消息 */
.video-stream:empty + .error-message {
  display: block;
}
  </style>
</head>

<body>

  <header>
    <h1>智慧农业边缘云控一体化系统</h1>
    <div>
        <a href="index.html">数据显示页面</a>
        <a href="control.html">控制页面</a>
        <a href="video.html">实时环境监控</a>
    </div>
  </header>
  </br>
    <style>
      /* 设置 body 元素的外边距为 0，去除浏览器默认的间距 */
      body {
        margin: 0;
      }
  
      /* 设置 header 的样式，确保它固定在页面顶部 */
      header {
        text-align: center;        /* 文字居中 */
        position: fixed;           /* 固定定位 */
        top: 0;                    /* 位于页面顶部 */
        width: 100%;               /* 宽度占满整个页面 */
        z-index: 1000;             /* 确保 header 在最前面 */
      }
        body {
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #333;
        }
        img {
            max-width: 100%;
            border: 2px solid white;
            border-radius: 10px;
            background-color: rgb(238, 231, 231);
        }
    </style>
</head>
    <!-- 引用 MJPEG 流 -->
    <img src="http://192.168.51.214:8080/?action=stream" alt="视频流加载失败"/>
    

</body>
</html>